package com.example.demo.entity.request.user;

import com.example.demo.common.entity.request.BaseRequest;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;

/**
 * 用户请求对象.
 *
 * @author Mei Ruoxiao
 * @since 2020/8/31
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel("用户信息请求")
public class UserRequest extends BaseRequest {

    @NotEmpty(message = "名称不能为空")
    @Length(message = "名称不能超过{max}个字符", max = 50)
    @ApiModelProperty(value = "名称", required = true, example = "张三")
    private String name;

    @NotEmpty(message = "密码不能为空")
    @Length(message = "密码为6-16个字符", min = 6, max = 16)
    @ApiModelProperty(value = "密码", required = true, example = "zs98754")
    private String password;
}
